﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Http.Controllers;
using System.Web.Http.Filters;
using YinfangWeb.BLL.Enum;

namespace YinfangWeb.Api
{
    /// <summary>
    /// 判断该用户是否为指定角色
    /// </summary>
    public class ValidRoleAttribute : ActionFilterAttribute
    {
        /// <summary>
        /// 自定义参数
        /// </summary>
        private EnumUserRole Role { get; set; }

        /// <summary>
        /// 默认构造方法
        /// </summary>
        public ValidRoleAttribute()
        {
        }
        /// <summary>
        /// 带参构造方法-角色
        /// </summary>
        /// <param name="message"></param>
        public ValidRoleAttribute(EnumUserRole role)
        {
            Role = role;
        }
        public override void OnActionExecuting(HttpActionContext context)
        {
            base.OnActionExecuting(context);
        }
    }
}